package edu.gdkm;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

@Data
@AllArgsConstructor
@NoArgsConstructor
@Component
public class Teacher {
    @Value("小王")
    private String name;
    @Value("Java")
    private String course;
    public void teach() {
        System.out.println("教师名："+name+"\n课程："+course);
    }
}
